package com.example.hello;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.EditText;
import android.widget.TextView;

public class MainActivity extends AppCompatActivity {
    public  static  final  String TAG="mylog";
    TextView out;
    EditText edit;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        edit = findViewById(R.id.inp);


    }
    public void myclick(View v) {
        String s1=edit.getText().toString();
        double s2=Double.parseDouble(s1);
        double s3=s2*33.8;
        Log.i(TAG,"myclick():s3="+s3);
        out=findViewById(R.id.textView);
        out.setText("结果为："+s3);

    }
}